package com.ciwong.epaper.modules.msg.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;


import com.ciwong.epaper.modules.me.ui.HasDoneHomeWorkActivity;
import com.ciwong.epaper.modules.me.ui.EarlierHomeWorkActivity;
import com.ciwong.epaper.modules.msg.bean.MessageInfo;
import com.ciwong.epaper.modules.msg.ui.MyMessageActivity;
import com.ciwong.epaper.modules.msg.ui.WorkMessageActivity;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.mobilelib.utils.BaseJumpManager;

/**
 * Created by res-yinxue on 2016/6/16.
 */
public class MessageJumpManager extends BaseJumpManager {
    /**
     * 跳转到消息界面
     */
    public static void jumpToMsgActivity(Activity act, int goBackId,int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, MyMessageActivity.class);
        act.startActivityForResult(intent,requestCode);

    }

    /**
     * 跳转到已完成界面
     */
    public static void jumpToHasDoneHomeWorkActivity(Activity act, int goBackId,int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, HasDoneHomeWorkActivity.class);
        act.startActivityForResult(intent,requestCode);

    }
    /**
     * 跳转到30天外未完成作业界面
     */
    public static void jumpToRectentHomeWorkActivity(Activity act, int goBackId,int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, EarlierHomeWorkActivity.class);
        act.startActivityForResult(intent,requestCode);

    }

    /**
     * 推送通知跳转至消息界面
     */
    public static void jumpToMessageActivity(Context context, int goBackId) {
        //Intent intent = getBaseIntent(goBackId, act, MyMessageActivity.class);
        // act.startActivity(intent);

        Intent intent = new Intent(context, MyMessageActivity.class);
        intent.putExtra(INTENT_FLAG_SOURCE, true);
        intent.putExtra(GO_BACK_ID, goBackId);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(intent);
    }



    /**
     * 跳转到“作业消息”
     */
    public static void jumpToWorkMsgActivity(Activity act, int goBackId, MessageInfo msg, int requestCode) {
        Intent intent = getBaseIntent(goBackId, act, WorkMessageActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, msg);
        act.startActivityForResult(intent,requestCode);
    }

   /* public static void jumpToUserDKListActivity(Activity activity, int goBackId){
        Intent intent = new Intent(activity, UserDKListActivity.class);

        intent.putExtra(GO_BACK_ID, goBackId);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        activity.startActivity(intent);
    }*/





}
